package com.ruoyi.background.mapper;

import com.ruoyi.background.domain.AppGradeRecord;

import java.util.List;

/**
 * 积分记录Mapper接口
 *
 * @author susu
 * @date 2024-08-18
 */
public interface AppGradeRecordMapper {
    /**
     * 查询积分记录
     *
     * @param id 积分记录主键
     * @return 积分记录
     */
    public AppGradeRecord selectAppGradeRecordById(Long id);

    /**
     *
     * @param userId 用户id
     * @return count
     */
    public Integer countByUserId(Long userId);

    /**
     * 查询积分记录列表
     *
     * @param appGradeRecord 积分记录
     * @return 积分记录集合
     */
    public List<AppGradeRecord> selectAppGradeRecordList(AppGradeRecord appGradeRecord);

    /**
     * 新增积分记录
     *
     * @param appGradeRecord 积分记录
     * @return 结果
     */
    public int insertAppGradeRecord(AppGradeRecord appGradeRecord);

    /**
     * 修改积分记录
     *
     * @param appGradeRecord 积分记录
     * @return 结果
     */
    public int updateAppGradeRecord(AppGradeRecord appGradeRecord);

    /**
     * 删除积分记录
     *
     * @param id 积分记录主键
     * @return 结果
     */
    public int deleteAppGradeRecordById(Long id);

    /**
     * 批量删除积分记录
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteAppGradeRecordByIds(Long[] ids);

    /**
     * 获取用户累计获取的积分
     *
     * @param userId 用户id
     * @return int
     */
    public Integer getUserCountInGrade(Long userId);
}
